package com.springcloud.hysitrix.service;

import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Title: PaymentService
 * Description: TODO
 *
 * @author gejx
 * @version V1.0
 * @date 2021-12-29
 */
@Component
@FeignClient(value = "CLOUD-PRIVDER-HYSTRIX-PAYMENT",//euerka上注册的服务
        fallback = PaymentFallbackService.class//调用统一处理类
)
//@DefaultProperties//(defaultFallback = "payment_Global_FallbackMethod")//全局
public interface PaymentService {
    @GetMapping("/payment/get/ok/{id}")
    String paymentInfo_ok(@PathVariable("id") Integer id);

    @GetMapping("/payment/get/timeout/{id}")
    String paymentInfo_Timeout(@PathVariable("id")Integer id);
}
